Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix IsTopLevelManifest calculation for versioned manifests #381

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

asraa
Copy link
Contributor

@asraa asraa commented Sep 9, 2022

Signed-off-by: Asra Ali asraa@google.com

Please fill in the fields below to submit a pull request. The more information that is provided, the better.

Fixes #380
Release Notes:

  • fix: fixes bug in calculation of top-level manifest for versioned manifests

Types of changes:

  • [ x ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of the changes being introduced by the pull request:
Fixes the calculation of whether a manifest is a top-level one when the manifest is versioned. Previously, a manifest like 1.root.json would be detected as a delegated manifest because it was 1.root was not in the set of top-level manifests. This now accounts for versioned manifests.

Please verify and check that the pull request fulfills the following requirements:

  • [ x ] Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Signed-off-by: Asra Ali <asraa@google.com>
@asraa asraa changed the title fix: fix is top level calculation for versioned manifests fix: fix IsTopLevelManifest calculation for versioned manifests Sep 9, 2022
znewman01
znewman01 previously approved these changes Sep 9, 2022
internal/roles/roles.go Outdated Show resolved Hide resolved
Signed-off-by: Asra Ali <asraa@google.com>

oops

Signed-off-by: Asra Ali <asraa@google.com>

lint

Signed-off-by: Asra Ali <asraa@google.com>
znewman01
znewman01 previously approved these changes Sep 12, 2022
Copy link
Contributor

@znewman01 znewman01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if you can make lint happy

Also do you need to declare var found bool on a separate line?

@asraa
Copy link
Contributor Author

asraa commented Sep 12, 2022

Also do you need to declare var found bool on a separate line?

Yes, only because I re-use the name field. I either have to declare another name var on another separate line or that one

Signed-off-by: Asra Ali <asraa@google.com>
@asraa asraa merged commit a9ddd89 into theupdateframework:master Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] RemoveTargetFromExpires attempts to remove a target from versioned top-level roles
4 participants